var xShift = -25;
var yShift = -120;
var coordinates = [
        [39,229],           // PSP
        [121,229],          // PU
        [201,229],          // IQgen

        [356,186],          // GEN
        [199,141],           // G
        [202,322],          // G

        [356,273],          // phaseRot
        [269,64],           // sinI
        [269,394],          // cosQ

        [596,274],         // phaseRotator1
        [596,185],         // Gen1
        [734,226],         // decod

        [736,135],         // lpf1
        [736,316],         // lpf2
        [814,225],         // pu

        [911,225],         // PSP
		
		[462,322],         // Ngen
		[202,322]         // 1/Z
]

function startupFunction(){
    // PSP 1
    psp.xCoord = xShift + coordinates[0][0];
    psp.yCoord = yShift + coordinates[0][1];
    // PU
    pu.xCoord = xShift + coordinates[1][0];
    pu.yCoord = yShift + coordinates[1][1];
    // IQgen
    iqgen.xCoord = xShift + coordinates[2][0];
    iqgen.yCoord = yShift + coordinates[2][1];
    // Generetor
    gen.xCoord = xShift + coordinates[3][0];
    gen.yCoord = yShift + coordinates[3][1];
    // gFir
    gFir1.xCoord = xShift + coordinates[4][0];
    gFir1.yCoord = yShift + coordinates[4][1];
    // gFir
    gFir2.xCoord = xShift + coordinates[5][0];
    gFir2.yCoord = yShift + coordinates[5][1];
    // Phase Rotator
    phaseRotator.xCoord = xShift + coordinates[6][0];
    phaseRotator.yCoord = yShift + coordinates[6][1];
    // sin I
    sinI.xCoord = xShift + coordinates[7][0];
    sinI.yCoord = yShift + coordinates[7][1];
    // cos Q
    cosQ.xCoord = xShift + coordinates[8][0];
    cosQ.yCoord = yShift + coordinates[8][1];
    // Phase Rotator
    phaseRotator1.xCoord = xShift + coordinates[9][0];
    phaseRotator1.yCoord = yShift + coordinates[9][1];
    // generator
    gen1.xCoord = xShift + coordinates[10][0];
    gen1.yCoord = yShift + coordinates[10][1];
    //decod
    decod.xCoord = xShift + coordinates[11][0];
    decod.yCoord = yShift + coordinates[11][1];
    // LPF 1
    lpf.xCoord = xShift + coordinates[12][0];
    lpf.yCoord = yShift + coordinates[12][1];
    // LPF 2
    lpf1.xCoord = xShift + coordinates[13][0];
    lpf1.yCoord = yShift + coordinates[13][1];
    // PU 2
    pu1.xCoord = xShift + coordinates[14][0];
    pu1.yCoord = yShift + coordinates[14][1];
    // PSP 2
    psp1.xCoord = xShift + coordinates[15][0];
    psp1.yCoord = yShift + coordinates[15][1];
	// Noise Gen
	ngen.xCoord = xShift + coordinates[16][0];
	ngen.yCoord = yShift + coordinates[16][1];
	// 1/Z
	z1.xCoord = xShift + coordinates[17][0];
	z1.yCoord = yShift + coordinates[17][1];
}

function resizeWidth(koeff){
	if ((parent.width/parent.height)<16/9) return koeff*parent.width;
	else return koeff*parent.height*16/9; 
}

function resizeHeight(koeff){
	if ((parent.width/parent.height)>16/9) return koeff*parent.height;
	else return koeff*parent.width*9/16;
	
}